package com.tuniu.agents.common.entity.cart;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Cart model class
 */
public class Cart {
    /**
     * Selected resources
     */
    private List<CartItem> selectItems;
   /**
    * Packageable resources
    */
    private List<CartItem> packageItems;

    public List<CartItem> getSelectItems() {
        return selectItems;
    }
    public void setSelectItems(List<CartItem> selectItems) {
        this.selectItems = selectItems;
    }
    public List<CartItem> getPackageItems() {
        return packageItems;
    }
    public void setPackageItems(List<CartItem> packageItems) {
        this.packageItems = packageItems;
    }

    /**
     * Get selected resources as a string
     * @return Selected resources string
     */
    public  String getSelectItemsString() {
        return selectItems.stream().map(CartItem::toString).collect(Collectors.joining(","));
    }

    /**
     * Get packageable resources as a string
     * @return Packageable resources string
     */
    public  String getPackageItemsString() {
        return packageItems.stream().map(CartItem::toString).collect(Collectors.joining(","));
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        sb.append("Selected Resources=").append(selectItems);
        sb.append(", Packaged Resources=").append(packageItems);
        sb.append('}');
        return sb.toString();
    }



   


   
} 